package com.huawei.appmarket.oobe.app;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat.d;
import com.huawei.appmarket.R;
import o.cei;
import o.dls;
import o.Logger;
import o.ContentManager;
import o.eqp;
import o.fo;

public class OOBESupportService extends Service {
    public static void startService() {
        if (!eqp.ʼ()) {
            Logger.ˎ("OOBE", "OOBESupportService.startService");
            Context ˋ = ContentManager.getInstant().getContext();
            fo.ॱ(ˋ, new Intent(ˋ, OOBESupportService.class));
            dls.ॱ();
        }
    }

    public static void stopService() {
        Logger.ˎ("OOBE", "OOBESupportService.stopService");
        try {
            Context ˋ = ContentManager.getInstant().getContext();
            ˋ.stopService(new Intent(ˋ, OOBESupportService.class));
        } catch (Exception e) {
            Logger.ˋ("OOBE", "stopService Exception:" + e.getMessage());
        }
    }

    public int onStartCommand(Intent intent, int i, int i2) {
        ॱ();
        return super.onStartCommand(intent, i, i2);
    }

    @Nullable
    public IBinder onBind(Intent intent) {
        return null;
    }

    private void ॱ() {
        cei.ˏ(this, 2018012702, new d(this).ˏ("AppGallery").ˊ("").ˊ(R.drawable.appmarket_notify_smallicon).ˊ(System.currentTimeMillis()).ˏ(true));
    }

    public void onDestroy() {
        stopForeground(true);
        super.onDestroy();
    }
}
